import {createRouter,createWebHistory} from 'vue-router'

export default createRouter({
	history: createWebHistory(), // 路由模式
	// 路由配置
	routes: [
		{
			path:'/',
			redirect:'/home'
		},
		{
			path: '/home',
			component: () => import('@/pages/home/home.vue'),
			meta:{
				title:'首页'
			}
		},
		{
			path:'/hospital',
			component: () => import('@/pages/hospital/hospital.vue'),
			children:[
				{
					path:'/hospital/',
					redirect:'/hospital/detail'
				},
				{
					path:'detail',
					component: () => import('@/pages/hospital/content/Detail.vue'),
					meta:{
						title:'医院详情'
					}
				},
				{
					path:'close',
					component: () => import('@/pages/hospital/content/Close.vue'),
					meta:{
						title:'停诊信息'
					}
				},
				{
					path:'register',
					component: () => import('@/pages/hospital/content/Register.vue'),
					meta:{
						title:'预约挂号'
					}
				},
				{
					path:'register_step1',
					component: () => import('@/pages/hospital/content/step/Register_step1.vue'),
					meta:{
						title:'预约第一步'
					}
				},
				{
					path:'register_step2',
					component: () => import('@/pages/hospital/content/step/Register_step2.vue'),
					meta:{
						title:'预约第二步'
					}
				},
				{
					path:'notice',
					component: () => import('@/pages/hospital/content/Notice.vue'),
					meta:{
						title:'预约须知'
					}
				},
				{
					path:'cancel',
					component: () => import('@/pages/hospital/content/Cancel.vue'),
					meta:{
						title:'查询取消'
					}
				}
			]
		},
		{
			path:'/wxlogin',
			component: () => import('@/pages/wxLogin.vue'),
		},
		{
			path:'/user',
			component: () => import('@/pages/user/user.vue'),
			children:[
				{
					path:'approve',
					component: () => import('@/pages/user/content/Approve.vue'),
					meta:{
						title:'实名认证'
					}
				},
				{
					path:'feedback',
					component: () => import('@/pages/user/content/Feedback.vue'),
					meta:{
						title:'意见反馈'
					}
				},
				{
					path:'order',
					component: () => import('@/pages/user/content/Order.vue'),
					meta:{
						title:'挂号订单'
					}
				},
				{
					path:'patient',
					component: () => import('@/pages/user/content/Patient.vue'),
					meta:{
						title:'就诊人管理'
					}
				},
				{
					path:'Profile',
					component: () => import('@/pages/user/content/Profile.vue'),
					meta:{
						title:'账号管理'
					}
				},
				{
					path:'/user',
					redirect:'/user/approve'
				}
			]
		}
	],
	// 滚动行为
	scrollBehavior(){
		return{
			left:0,
			top:0
		}
	}
})